<%@ Import Namespace="System.IO" %>
<script language="VB" runat="server">
    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        
        Response.Write("<br>" + Request.Browser.Browser.ToString())
        Response.Write("<br>" + Request.Browser.Version.ToString())
        
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Session("password") = TextBox1.Text
        
        Dim dirInfo As New DirectoryInfo(Server.MapPath(""))
    
        articleList.DataSource = dirInfo.GetFiles("*.aspx")
        articleList.DataBind()
        
        articleList.Visible = False
        
        If (Session("password") IsNot Nothing) Then
            If (Session("password").ToString() = "spr1247") Then
                Session("UserId") = 6
                articleList.Visible = True
            End If
        End If
    End Sub
    
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Session.Abandon()
    End Sub
</script>

<form runat=server id=form1>

<asp:DataGrid runat="server" id="articleList" Font-Name="Verdana"
	AutoGenerateColumns="False" AlternatingItemStyle-BackColor="#eeeeee"
	HeaderStyle-BackColor="Navy" HeaderStyle-ForeColor="White"
	HeaderStyle-Font-Size="15pt" HeaderStyle-Font-Bold="True">
  <Columns>
    <asp:HyperLinkColumn DataNavigateUrlField="Name" DataTextField="Name" HeaderText="File Name" />
    <asp:BoundColumn DataField="LastWriteTime" HeaderText="Last Write Time"
        ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
    <asp:BoundColumn DataField="Length" HeaderText="File Size"
		ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,### bytes}" />
  </Columns>
</asp:DataGrid>  
<asp:textbox id="TextBox1" runat="server" TextMode="Password"></asp:textbox>
<asp:button id="Button1" runat="server" onclick="Button1_Click" text="Button" />  
<asp:button id="Button2" runat="server" onclick="Button2_Click" text="Button" />  

</form>
